Skip to content

Conversation

@isabelizimm
Copy link
Collaborator

@isabelizimm isabelizimm commented Oct 21, 2022

Description

Include a brief description of the problem being solved and why this
approach was chosen. Mention risks or shortcomings with this solution.
Provide relevant background information such as the associated issue, links
to design documents, screenshots, and performance measurements.

Even small changes deserve a little attention to detail. Put your change in
context.

Connected to #269
Would unblock rstudio/vetiver-python#119

Testing Notes / Validation Steps

Explain how this change has been tested and what cases/conditions are
covered. Enumerate the steps someone might take to manually exercise this
change. Detail is important!

You can recommend one-time manual testing when someone validates your
changes. Rely on automation when trying to verify that a change remains in
place. Automated tests should be included in this PR.

@isabelizimm isabelizimm marked this pull request as ready for review October 21, 2022 20:36
@mmarchetti
Copy link
Contributor

There is a reason we use pip list --format=freeze instead of pip freeze, but it is subtle and probably not well documented.

pip freeze preserves some build metadata (IIRC it is specified in PEP 518). When you run pip freeze in a conda environment, it includes build-system paths for all the packages. pip installing with those present does not work because of course the paths don't exist on the target system. Connect strips them out if present, but we preferred to avoid sending them. pip list excludes those paths, even when format=freeze. That may change eventually.

@isabelizimm
Copy link
Collaborator Author

Thank you for the explanation, that all makes sense! 🙌 The way I encounter this the most is when I use a github version of a package (via rsconnect.actions.deploy_python_fastapi), and pip list generates a version of a package that is not-downloadable from PyPI, even though it looks like it should be (vetiver==0.1.7.post41+g60e590a), so I encounter an error on Connect. When I pass in my own requirements.txt, it is overwritten by the pip list one that is generated. I can pass in a requirements file named something else, but Connect will still install the requirements.txt, which is a totally reasonable guess, just not helpful in this case.

Is there a way I am missing to accomplish installing GH packages?

@mmarchetti
Copy link
Contributor

We discussed at our kickoff this morning. You can create requirements.txt and Connect will use it, but we are also considering switching to "pip freeze" as that will improve the automatic capture.

@isabelizimm
Copy link
Collaborator Author

Oh awesome! That would be great (selfishly 😄) if pip freeze was used.

You can create requirements.txt and Connect will use it

From what I am seeing, a requirements.txt is generated every time, which will overwrite any file I am passing with the name requirements.txt, but if any other file name will be ignored in favor of installing from the generated requirements.txt file. Maybe this should be a separate issue?

@bcwu bcwu mentioned this pull request Nov 28, 2022
@isabelizimm
Copy link
Collaborator Author

duplicate of #309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants